/**
 * (C) 2007 - Boston University
 * 	Contact: Michael Ocean 

  This work is a part of the larger snBench project.  Information
  can be found at: http://csr.bu.edu/snbench

  This program is free software; you can redistribute it and/or
  modify it under the terms of Version 2 of the GNU General Public 
  License.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
  
  You should have received a copy of the GNU Library General Public
  License along with this library; if not, write to the Free
  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
package snobject;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;

public class SerializableImage extends snObject{

	/**
	 * @param args
	 */
	int[] bytes;
	int height;
	int width;
	int imageType;
	
	public SerializableImage(BufferedImage image){
		this.height = image.getHeight();
		this.width = image.getWidth();
		this.imageType = image.getType();
		bytes = new int[this.width*this.height];
		image.getRGB(0,0,image.getWidth(),image.getHeight(),this.bytes,0,image.getWidth());
	}
	public BufferedImage getBufferedImage() {
		BufferedImage image = new BufferedImage(this.width,this.height,this.imageType);
		image.setRGB(0,0,this.width,this.height,this.bytes,0,this.width);
		return image;
	}
	@Override
	public String getXmlMimeType() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public String getWebMimeType() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public String getBinaryMimeType() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public void xmlWrite(OutputStream out, int depth) throws IOException {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void webWrite(OutputStream out, int depth) throws IOException {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void binaryWrite(OutputStream out) throws IOException {
		// TODO Auto-generated method stub
		
	}

}
